﻿@import './variables';

html,
body {
  overflow: hidden;
  overflow-y: auto;
  margin: 0 auto;
  min-width: 360px;
  min-height: 100%;
  position: relative;
  padding: 0;
  height: 100%;
  font-size: 12px;
  color: #212529;
  font-family: "PingFang SC", Arial, "Microsoft YaHei", sans-serif;
  background: @bodyBackgroundColor;
  font-size-adjust: 100%;

  label {
    font-weight: bold;
  }
}

body {
  .content {
    display: inline-block;
    width: 100%;
    margin: auto auto;
    margin-top: 0;
    overflow: auto;
    margin-top: 5px;
    padding: 0 10px;
    border-radius: 5px;
    background: @contentColor;
    margin-bottom: 0;

    >.content-wrapper {
      margin: 0 0;
      position: relative;

      .section {
        padding: 8px 10px;
        border-radius: 5px;
        background-color: #fff;
        margin-bottom: 10px;

        &.clear {
          margin-bottom: 0;
        }
      }
    }
  }
}

.ivu-menu {

  .ivu-menu-item-active,
  .ivu-menu-item-selected {
    border-bottom: 4px solid #2d8cf0;
  }

  .ivu-select-dropdown {
    overflow-x: hidden;
  }
}

.header-type(@bgColor) {
  .ivu-card-head {
    color: #fff;
    background: @bgColor;
    border: 1px solid @bgColor;
  }

  .ivu-card-body {
    border: 1px solid @bgColor;
  }
}

.ivu-form-item {
  margin-bottom: 0;
}

.ivu-table-cell {
  padding-left: 5px;
  padding-right: 5px;
}

.ivu-btn {
  >span:empty {
    display: none;
  }
}

.ivu-card {
  margin: 5px 0px 5px 0px;

  .ivu-card-body {
    padding: 0;
    border-radius: 0 0 5px 5px;

    &>div {
      padding: 5px 10px;
    }

    .ivu-form-item {
      margin-bottom: 10px;
    }
  }

  .ivu-card-head {
    height: 38px;
    cursor: default;
    vertical-align: middle;
    line-height: 34px;
    border: none;
    border-bottom: 1px solid #dcdcdc;
    display: flex;
    align-items: center;
    font-weight: bold;
    padding: 0 5px 0 10px;
    border-radius: 5px 5px 0 0;

    &>span {
      &:first-of-type {
        flex: 1;

        .ivu-icon {
          position: relative;
          top: 3px;
        }
      }
    }

    &>.chevron {
      padding-left: 5px;
      padding-right: 15px;
    }

    .ivu-btn-group {
      top: 0.5px;
      right: 1px;

      &>.ivu-btn {
        height: 36px;
        line-height: 23px;
        padding-top: 2px;

        .ivu-icon {
          font-size: 20px;
        }
      }
    }
  }

  &.primary {
    .header-type(@primaryColor);
  }

  &.info {
    .header-type(@infoColor);
  }

  &.success {
    .header-type(@successColor);
  }

  &.warning {
    .header-type(@warningColor);
  }

  &.error {
    .header-type(@warningColor);
  }
}

.ivu-form {
  .ivu-row {
    .ivu-col {
      padding-right: 5px;
    }

    .ivu-form-item-error {
      height: 45px;
    }
  }

  &:not(:first-child) {
    margin-top: 10px;
  }
}

table.table {
  width: 100%;
  border: 1px solid #e9eaec;

  &>thead {

    &>th,
    &>td {
      line-height: 24px;
      border: 1px solid #e9eaec;
      background-color: #f8f8f9;
    }
  }

  &>tbody {
    &>tr {
      &:hover {
        background: #ebf7ff;
      }

      &>td {
        line-height: 22px;
        border: 1px solid #e9eaec;

        &:empty {
          content: ' ';
        }
      }
    }
  }

  .btn-icon {
    top: -2px;
    position: relative;
  }

  .ivu-table-cell {
    padding-left: 5px;
    padding-right: 5px;
  }
}

.ivu-btn>.ivu-icon+span,
.ivu-btn>span+.ivu-icon {
  margin-left: 0;
}

.text-info {
  color: @infoColor;
}

.text-success {
  color: @successColor;
}

.text-warning {
  color: @warningColor;
}

.text-error {
  color: @errorColor;
}

.createBgStyle(@bgColor) {
  background: @bgColor;
  padding: 10px 15px;
  border-radius: 5px;
  color: #fff;
  font-size: 16px;
}

.bg-primary {
  .createBgStyle(@primaryColor);
}

.bg-info {
  .createBgStyle(@infoColor);
}

.bg-success {
  .createBgStyle(@successColor);
}

.bg-warning {
  .createBgStyle(@warningColor);
}

.bg-error {
  .createBgStyle(@errorColor);
}

section {
  background: @sectionBackgroundColor;
  border-radius: 8px;
  margin-bottom: 5px;
  padding: 8px 8px;

  .ivu-row {
    &:last-of-type {
      .ivu-form-item {
        margin-bottom: 0;
      }
    }
  }
}

.spin-icon-load {
  animation: ani-spin-spin 1s linear infinite;
}

.ivu-tabs {
  .ivu-tabs-bar {
    margin-bottom: 0;
  }

  .ivu-tabs-tabpane {
    margin-top: 10px;
  }

  .ivu-tabs-nav {
    >.ivu-tabs-tab {
      margin-right: 10px;
      text-align: left;
      padding-left: 2px;
    }

    >.ivu-tabs-tab-active {
      &:before {
        content: " ";
        margin-right: 5px;
        border-radius: 4px;
        border-left: 15px solid #1e91e8;
      }

    }
  }
}

@keyframes ani-spin-spin {
  from {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(180deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.spin-spin-col {
  height: 100px;
  position: relative;
  border: 1px solid #eee;
}

body::-webkit-scrollbar {
  width: 6px;
  height: 12px;
}

body::-webkit-scrollbar-track {
  border-radius: 0;
  background-color: transparent;
}

body::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background-color: #1e91e8;
}

div::-webkit-scrollbar {
  width: 6px;
  height: 12px;
}

div::-webkit-scrollbar-track {
  border-radius: 0;
  background-color: transparent;
}

div::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background-color: #1e91e8;
}